package myky.com.doctorapp.presenter;

import io.reactivex.disposables.Disposable;
import myky.com.doctorapp.entity.UserEntity;
import myky.com.doctorapp.base.BasePresenterIm;
import myky.com.doctorapp.base.RxSubscribe;
import myky.com.doctorapp.contract.MineFragmentContract;
import myky.com.doctorapp.model.MineFragmentModel;

/**
 * Description:
 * @author wuyang
 * Created by 2018/12/28 16:14
 */
public class MineFragmentPresenter extends BasePresenterIm<MineFragmentContract.View> implements MineFragmentContract.Presenter {


    MineFragmentModel mineFragmentModel;


    public MineFragmentPresenter() {
        mineFragmentModel=new MineFragmentModel();
    }

    @Override
    public void getUserInfo() {


        mineFragmentModel.getuserinfo().subscribe(new RxSubscribe<UserEntity.PayLoadBean>() {
            @Override
            protected void onSuccess(UserEntity.PayLoadBean payLoadBean) {

                mView.showUserInfo(payLoadBean);
            }

            @Override
            protected void onFailed(int code, String msg) {

            }

            @Override
            public void onSubscribe(Disposable d) {
                addSubscription(d);
            }
        });
    }
}
